package com.liukai.todo_android.entity.vo;

import com.liukai.todo_android.entity.ItemVo;

import java.text.SimpleDateFormat;
import java.util.Date;

public class UpdateItemVo {

    private Long id;

    private String title;

    private Long itemTypeId;

    private String description;

    private String attachment;

    private Date gmtStarted;

    private Integer consumePlanning;

    private Byte timingType;

    private Byte finished;

    private Date gmtFinished;

    private String summary;

    public Long getId() {
        return id;
    }

    public UpdateItemVo setId(Long id) {
        this.id = id;
        return this;
    }

    public String getTitle() {
        return title;
    }

    public UpdateItemVo setTitle(String title) {
        this.title = title;
        return this;
    }

    public Long getItemTypeId() {
        return itemTypeId;
    }

    public UpdateItemVo setItemTypeId(Long itemTypeId) {
        this.itemTypeId = itemTypeId;
        return this;
    }

    public String getDescription() {
        return description;
    }

    public UpdateItemVo setDescription(String description) {
        this.description = description;
        return this;
    }

    public String getAttachment() {
        return attachment;
    }

    public UpdateItemVo setAttachment(String attachment) {
        this.attachment = attachment;
        return this;
    }

    public Date getGmtStarted() {
        return gmtStarted;
    }

    public UpdateItemVo setGmtStarted(Date gmtStarted) {
        this.gmtStarted = gmtStarted;
        return this;
    }

    public Integer getConsumePlanning() {
        return consumePlanning;
    }

    public UpdateItemVo setConsumePlanning(Integer consumePlanning) {
        this.consumePlanning = consumePlanning;
        return this;
    }

    public Byte getTimingType() {
        return timingType;
    }

    public UpdateItemVo setTimingType(Byte timingType) {
        this.timingType = timingType;
        return this;
    }

    public Byte getFinished() {
        return finished;
    }

    public UpdateItemVo setFinished(Byte finished) {
        this.finished = finished;
        return this;
    }

    public Date getGmtFinished() {
        return gmtFinished;
    }

    public UpdateItemVo setGmtFinished(Date gmtFinished) {
        this.gmtFinished = gmtFinished;
        return this;
    }

    public String getSummary() {
        return summary;
    }

    public UpdateItemVo setSummary(String summary) {
        this.summary = summary;
        return this;
    }

    @Override
    public String toString() {
        return "UpdateItemVo{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", itemTypeId=" + itemTypeId +
                ", description='" + description + '\'' +
                ", attachment='" + attachment + '\'' +
                ", gmtStarted=" + gmtStarted +
                ", consumePlanning=" + consumePlanning +
                ", timingType=" + timingType +
                ", finished=" + finished +
                ", gmtFinished=" + gmtFinished +
                ", summary='" + summary + '\'' +
                '}';
    }

    public static UpdateItemVo build(ItemVo itemVo) {
        UpdateItemVo updateItemVo = new UpdateItemVo();
        if (itemVo.getId() != null) {
            updateItemVo.setId(itemVo.getId());
        }
        if (itemVo.getTitle() != null) {
            updateItemVo.setTitle(itemVo.getTitle());
        }
        if (itemVo.getTimingType() != null) {
            updateItemVo.setTimingType(itemVo.getTimingType());
        }
        if (itemVo.getDescription() != null) {
            updateItemVo.setDescription(itemVo.getDescription());
        }
        if (itemVo.getGmtStarted() != null) {
            updateItemVo.setGmtStarted(itemVo.getGmtStarted());
        }
        if (itemVo.getAttachment() != null) {
            updateItemVo.setAttachment(itemVo.getAttachment());
        }
        if (itemVo.getConsumePlanning() != null) {
            updateItemVo.setConsumePlanning(itemVo.getConsumePlanning());
        }
        if (itemVo.getFinished() != null) {
            updateItemVo.setFinished(itemVo.getFinished());
        }
        if (itemVo.getGmtFinished() != null) {
            updateItemVo.setGmtFinished(itemVo.getGmtFinished());
        }
        if (itemVo.getSummary() != null) {
            updateItemVo.setSummary(itemVo.getSummary());
        }
        return updateItemVo;
    }

}